﻿using CPPEI.WebApi;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XWeb.WebApi.App
{
    [AuthGetAction("app", "get", "1.0")]
    public class GetAction : BaseAction<GetParams, GetResult>
    {
        protected override ActionResult<GetResult> OnExecute(ActionContext context, SysParams sysParams, GetParams opParams)
        {
            GetResult actResult = new GetResult();
            actResult.Logo = string.Format("{0}/{1}", XWeb.Core.Cache.CurrentApp.BaseUrl, XWeb.Core.Cache.CurrentApp.Logo);
            actResult.Name = XWeb.Core.Cache.CurrentApp.Name;
            return new ActionResult<GetResult>(actResult);
        }
    }

    public class GetParams
    {
    }

    public class GetResult
    {
        public string Logo { get; set; }
        public string Name { get; set; }
    }
}
